#!/bin/sh
#desc:Start a playlist in mpg123
#package:odbgmusic
#type:local

CONFIGFILE="/etc/opendomo/music.conf"
. $CONFIGFILE

# Convert cover parameter in album

COVER=`echo $1 | tr + " "`
ALBUM=`cat $MUSICDB | grep "$COVER" | cut -f2 -d"(" | cut -f1 -d")"`

# Start music service

/etc/init.d/bgmusic start "$ALBUM" 

# Wait a moment, please ... for player start

sleep 2

# Always return to bgmusic web controler

/usr/local/opendomo/bgmusicControl.sh

